package com.hsmpay.mobile.service.added;

import com.hsmpay.common.pojo.qian4.Qian4SendLog;
import com.hsmpay.common.service.BaseService;
import com.hsmpay.mobile.pojo.added.AddedOrder;
import com.hsmpay.qian4.pojo.PurchaseResult;

import java.io.Serializable;

/**
 * 增值业务
 *
 * @param <Entity>
 * @param <Query>
 * @author 颜铃璋
 * @date 2014-7-16
 */
public interface AddedOrderService<Entity extends Serializable, Query extends Object> extends BaseService<Entity, Query> {
    /**
     * 增值业务插入订单 及收款信息
     *
     * @param send
     * @param addedOrder
     * @return 返回日志ID
     * @throws SQLException
     */
    public Long insertOrder(Qian4SendLog send, AddedOrder addedOrder) throws Exception;

    /**
     * 解析收款xml
     *
     * @param order
     * @param xml
     * @return
     * @throws Exception
     */
    public AddedOrder purchaseResolveXml(AddedOrder order, String xml) throws Exception;

    /**
     * 解析收款xml
     *
     * @param order
     * @param xml
     * @return
     * @throws Exception
     */
    public AddedOrder purchaseResolveResult(AddedOrder order, Qian4SendLog send, PurchaseResult pr) throws Exception;

    /**
     * 订单支付失败时修改 订单
     *
     * @param id
     * @param status
     */
    public int receivablesError(Long id, Integer status, String reqCode, String reqMsg) throws Exception;

    /**
     * 修改第三方 状态码  和描述
     *
     * @param id
     * @param status
     * @param thirdCode
     * @param thirdMsg
     * @return
     * @throws Exception
     */
    public int updateThirdCodeAndMsg(Long id, Integer status, String thirdCode, String thirdMsg, String thirdOrderNum) throws Exception;

    /**
     * 修改撤销
     *
     * @param id
     * @param status
     * @param revoCode
     * @param revoMsg
     * @param revoOrderNum
     * @return
     * @throws Exception
     */
    public int updateRevoCodeAndMsg(Long id, Integer status, String revoCode, String revoMsg, String revoOrderNum) throws Exception;

    /**
     * 修改第三方参数
     *
     * @param id
     * @param thirdParamMap
     * @throws Exception
     */
    public int updateThirdData(Long id, String thirdData) throws Exception;
}
